home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-03 | 3.0 KB | 101 lines | [TEXT/MPS ] |
- // UTheDebugger.h
- // Copyright © 1984-96 by Apple Computer, Inc. All rights reserved.
-
- #ifndef __UTHEDEBUGGER__
- #define __UTHEDEBUGGER__
-
- // MacApp
-
- #ifndef __MACAPPTYPES__
- #include "MacAppTypes.h"
- #endif
-
- //----------------------------------------------------------------------------------------
- // Forward class declarations
- //----------------------------------------------------------------------------------------
-
- class ClassDesc;
- class TObject;
-
- //----------------------------------------------------------------------------------------
- // Global function declarations
- //----------------------------------------------------------------------------------------
-
- // The following routines come to MacApp courtesy of Steve Jasik, and provide
- // support for Jasik's The Debugger from within the framework.
-
- #if qDebug | qTheDebugger
- // The Debugger is installed if Exception Vector at 0x38 points to a PEA instruction
- inline Boolean TheDbgr_IsInstalled(void) { return *(short *)(*(long *)0x38) == 0x487A; }
- #endif
-
- #if qTheDebugger
-
- #if !qPowerPC
- // The following two inlines allow storage into a CODE segment without
- // getting a Memory Protection Violation from 'The Debugger':
-
- inline pascal void TheDbgr_StoreWord(short value, void* addr) = {0x7008,0x4E47}; // MOVEQ #8,D0, TRAP #7
-
- inline pascal void TheDbgr_StoreLong(short value, void* addr) = {0x7009,0x4E47}; // MOVEQ #9,D0, TRAP #7
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
- typedef struct T_ObjList
- {
- long max_objs;
- long L_used;
- long n_holes;
- TObject* objs[1024]; // ptrs to the objects, longint indexing
- };
-
- typedef struct T_ClassList
- {
- ClassDesc* classes[256]; // ptrs to the objects, longint indexing
- };
-
- // NOTE: Boolean MUST BE A single byte
-
- typedef struct T_ExtDbgr
- {
- Boolean isBeingDebugged; // True if a Debugger & a .SYM file present }
- short MA_Version; // = 2 for MacApp 3.1 else 0
- short n_classes; // number of Object classes
- T_ClassList** pOrderedClass; // the tbl of ordered classes, Handle if MA3.1
- long hCLASINFO; // Handle to %_CLASINFO - MA3.0 and earlier
- T_ObjList** hMA_OBJ_List; // Handle to list of MacApp Objects
- long MA_JMPtoTrap; // @ %_JMP TO TRAP - MA3.0 and earlier
- long MA_FailNObj; // @ FailNonObject - MA3.0 and earlier
- long MA_DiscMeth; // @ PDisciplineMethodCalls:BOOLEAN
- T_ClassList** MA_ClassTblPtr; // Class Tbl Ptr - MA3.0 and earlier
- long MA_SelProcPtr; // SelectorProcTable - MA3.0 and earlier
- };
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- extern T_ExtDbgr gExtDbgr_Info;
-
- #if !qPowerPC
- // Debugger Callback - old was VAR ConsWR_Proc:Longint
- inline pascal Boolean TheDbgr_IsDbgrTask(T_ExtDbgr* comBlk, long* ConsWR_Proc) = {0x7007,0x4E47}; // MOVEQ #7,D0, TRAP #7
- #endif
-
- // procedures for the object list collector
-
- void TheDbgr_Add_Object(TObject* objHdl);
-
- void TheDbgr_Delete_Object(TObject* objHdl);
-
- void TheDbgr_Init_Ext_Dbgr();
-
- void TheDbgr_Adjust_ClassDescr_Ids(ClassDesc* pclassList, short numClasses);
-
- #endif // qTheDebugger
-
- #endif // __UTHEDEBUGGER__
-